package com.bdqn.service;

import com.bdqn.mapper.LogMapper;
import com.bdqn.pojo.Log;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

@Service
public class LogServiceImpl implements LogService{

    @Resource
    LogMapper logMapper;

    /**
     * 日志插入操作
     * @param log
     * @return
     */
    @Override
    public int add(Log log) {
        return logMapper.add(log);
    }

    @Override
    public int add(String content) {
        Log log = new Log();
        log.setContent(content);
        log.setCreateTime(new Date());
        return logMapper.add(log);
    }
}
